import  cv2 as cv
import numpy as np
# img= cv.imread("d:/mv1.png")
# b,g,r = cv.split(img) #split图片拆分3个通道 r g b
# print(b) #b = img[:,:,0]
# print(g) #g = img[:,:,1]
# print(r) #r = img[:,:,2]
# zeros = np.zeros(img.shape[:2], dtype=np.uint8)
# #merge合并通道
# b_img=cv.merge([b, zeros, zeros])
# g_img=cv.merge([zeros, g, zeros])
# r_img=cv.merge([zeros, zeros, r])
# cv.imshow('old img',img)
# cv.imshow('blue img',b_img)
# cv.imshow('green img',g_img)
# cv.imshow('red img',r_img)
# cv.waitKey(0)


blue = np.zeros((300,300,3),dtype=np.uint8)
cv.imshow('old',blue)
print(blue)
blue[:,:,2]=255
print("-"*30)
print(blue)
cv.imshow('b',blue)
cv.waitKey(0)